package cn.cvs.service.impl;

import cn.cvs.dao.SysUserMapper;
import cn.cvs.pojo.SysUser;
import cn.cvs.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import java.util.List;

@Controller
public class SysUserServiceImpl implements SysUserService {

    @Autowired
    private SysUserMapper sysUserMapper;

    @Override
    public SysUser login(String loginName, String password) {
        return sysUserMapper.login(loginName,password);
    }

    @Override
    public List<SysUser> list(Integer page, Integer limit,String loginName,String phonenumber,Integer deptId) {
         return sysUserMapper.list((page-1)*limit,limit,loginName,phonenumber,deptId);
    }

    @Override
    public int count(String loginName,String phonenumber,Integer deptId) {
        return sysUserMapper.count(loginName,phonenumber,deptId);
    }

    @Override
    public int delete(Integer userId) {
        return sysUserMapper.delete(userId);
    }

    @Override
    public int add(SysUser sysUser) {
        return sysUserMapper.add(sysUser);
    }

    @Override
    public int update(SysUser sysUser) {
        return sysUserMapper.update(sysUser);
    }

    @Override
    public SysUser queryById(Integer id) {
        return sysUserMapper.queryById(id);
    }

    @Override
    public List<SysUser> selectSome(String loginName, String phonenumber) {
        return sysUserMapper.selectSome(loginName,phonenumber);
    }

    @Override
    public int changeStatus(Integer id, char status) {
        return sysUserMapper.changeStatus(id,status);
    }
}
